/**
* @author Levin
* @desc 分享至各个SNS的模块
*/
Narato.M("Share",(function(){
	var pub={};
	pub.To=function(x,msg){
		var url = '', e = encodeURIComponent, s = screen, d = document, wd = 0, hg = 0, u = d.location;
		if(x=='tsohu'){
			url ="http://t.sohu.com/third/post.jsp?url="+e(u.href)+"&title="+e(d.title);
			wd = 660;hg = 470;
		}else if(x=='baisohu'){
			url ="http://bai.sohu.com/share/blank/addbutton.do?link="+e(u.href)+"&title="+e(d.title);
			wd = 480;hg = 340;
		}else if(x=='douban'){
			url ="http://www.douban.com/recommend/?url="+e(u.href)+"&title="+e(d.title);
			wd = 460;hg = 380;
		}else if(x=='renren'){
			url ="http://share.renren.com/share/buttonshare?link="+e(u.href)+"&title="+e(d.title);
			wd = 590;hg = 430;
		}else if(x=='kaixin'){
			url ="http://www.kaixin001.com/repaste/share.php?rurl="+e(u.href)+"&rtitle="+e(d.title);
			wd = 540;hg = 360;
		}else if(x=='gbuzz'){
			url ="http://www.google.com/buzz/post?url="+e(u.href)+"&message="+e(d.title);
			wd = 720;hg = 415;
		}else if(x=='tsina'){
			url="http://service.t.sina.com.cn/share/share.php?url="+e(u.href)+"&title="+e(d.title);
			wd=615;hg=505;
		}else if(x=='qqspace'){
			url="http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+e(u.href)+"&title="+e(d.title);
			wd=900;hg=505;
		}else if(x=='baidutb'){
			url ="http://tieba.baidu.com/i/sys/share?type=text&link="+e(u.href)+"&title="+e(d.title)+"&content="+e(d.title);
			wd = 626;hg = 436;
		}else if(x=='tqq'){
			url="http://v.t.qq.com/share/share.php?url="+e(u.href)+'&site='+e(u.domain)+'&title='+e(d.title);
			wd=700;hg=500;
		};	
		function a(){
			if (!window.open(url, 'vshare', ['toolbar=0,status=0,resizable=1,width='+ wd +',height='+ hg +',left='+ (s.width - wd) / 2+ ',top='+ (s.height - hg) / 2]))
				u.href = [url].join('');
		};
		if (/Firefox/.test(navigator.userAgent)){
			setTimeout(a, 0);
		}else{
			a();
		};
	};
	return pub;
})());